package com.shadow.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 任务配置.
 * @author Pbody
 * @since 2021/3/23 10:20
 */
@Getter
@Setter
@ToString(callSuper = true)
@TableName("DEMO_SCHEDULE_JOB")
public class ScheduleJobEntity implements Serializable {

    private static final long serialVersionUID = -5626326106946128124L;

    /**
     * 主键序列ID.
     **/
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    /**
     * 创建时间.
     **/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改时间.
     **/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifyTime;

    /**
     * spring bean名称.
     */
    private String beanName;

    /**
     * 方法名.
     */
    private String methodName;

    /**
     * 参数.
     */
    private String params;

    /**
     * cron表达式.
     */
    private String cronExpression;

    /**
     * 任务状态.
     */
    private Integer status;

    /**
     * 备注.
     */
    private String remark;

    /**
     * 关联的任务日志.
     **/
    @TableField(exist = false)
    private List<ScheduleJobLogEntity> scheduleJobLogList;
}
